package com.yuba.front.domain.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yuba.common.excel.annotation.ExcelDictFormat;
import com.yuba.common.excel.convert.ExcelDictConvert;
import com.yuba.common.translation.annotation.Translation;
import com.yuba.common.translation.constant.TransConstant;
import com.yuba.front.domain.Posts;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.List;


/**
 * 帖子视图对象 posts
 *
 * @author modakai
 * @date 2024-12-02
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = Posts.class)
public class PostsVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 对象存储主键
     */
    @ExcelProperty(value = "对象存储主键")
    private Long postId;

    /**
     * 用户ID
     */
    @ExcelProperty(value = "用户ID")
    private Long userId;

    private String username;

    @Translation(type = TransConstant.OSS_ID_TO_URL)
    private Long avatar;


    /**
     * 分类ID
     */
    @ExcelProperty(value = "分类ID")
    private Long categoryId;

    /**
     * 帖子标题
     */
    @ExcelProperty(value = "帖子标题")
    private String title;

    /**
     * 帖子内容
     */
    @ExcelProperty(value = "帖子内容")
    private String content;

    /**
     * 点赞
     */
    @ExcelProperty(value = "点赞")
    private Long likeCount;

    /**
     * 浏览量
     */
    @ExcelProperty(value = "浏览量")
    private Long viewCount;

    /**
     * 收藏量
     */
    @ExcelProperty(value = "收藏量")
    private Long collectCount;

    /**
     * 评论量
     */
    @ExcelProperty(value = "评论量")
    private Long commentCount;

    /**
     * 推荐分数
     */
    private Integer recommendScore;

    /**
     * 推荐时间戳
     */
    private Long recommendTime;

    /**
     * 封面图片OSSid
     */
    @ExcelProperty(value = "封面图片")
    @Translation(type = TransConstant.OSS_ID_TO_URL)
    private Long cover;

    /**
     * 是否精选
     */
    @ExcelProperty(value = "是否精选", converter = ExcelDictConvert.class)
    @ExcelDictFormat(dictType = "sys_yes_no")
    private String choiceFlag;

    /**
     * 是否置顶
     */
    @ExcelProperty(value = "是否置顶", converter = ExcelDictConvert.class)
    @ExcelDictFormat(dictType = "sys_yes_no")
    private String pinnedFlag;

    /**
     * 是否发布
     */
    @ExcelProperty(value = "是否发布", converter = ExcelDictConvert.class)
    @ExcelDictFormat(dictType = "sys_yes_no")
    private String releaseFlag;

    /**
     * 是否隐藏
     */
    @ExcelProperty(value = "是否隐藏 ", converter = ExcelDictConvert.class)
    @ExcelDictFormat(dictType = "sys_yes_no")
    private String showFlag;

    /**
     * 状态
     */
    @ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
    @ExcelDictFormat(dictType = "sys_common_status")
    private String status;

    /**
     * 编辑时间
     */
    @ExcelProperty(value = "编辑时间")
    private Date editTime;

    /**
     * 备注
     */
    @ExcelProperty(value = "备注")
    private String remark;

    private String imageUrl;

    /**
     * 标签列表
     */
    private List<String> tags;


}
